package com.gitee.wsl.struct.command.internal

import com.gitee.wsl.struct.command.model.parameters.GroupableOption
import com.gitee.wsl.struct.command.model.parameters.groups.ParameterGroup
import com.gitee.wsl.struct.command.model.parameters.options.Option

internal val Option.group: ParameterGroup? get() = (this as? GroupableOption)?.parameterGroup

internal fun List<UsageError>.throwErrors() {
    MultiUsageError.buildOrNull(this)?.let { throw it }
}
